Add patch to reinstate test-libglnx-shutil.c, which was missed out of the upstream...
authorSimon McVittie <smcv@debian.org>
Tue, 3 Oct 2017 20:33:21 +0000 (21:33 +0100)
committerSimon McVittie <smcv@debian.org>
Tue, 3 Oct 2017 21:47:46 +0000 (22:47 +0100)
debian/changelog
debian/patches/dist/Add-missing-test-libglnx-shutil.patch [new file with mode: 0644]
debian/patches/series

index 63350f8ba9d121a78df1bde4c23dfd61f228e8f0..28dcf9132749bb0a215b0c2384e31d627ea4897b 100644 (file)
@@ -12,6 +12,8 @@ ostree (2017.12-1) UNRELEASED; urgency=medium
     too
   * Make build-time test failures fatal if they fail at least twice
     out of 5 tries (previously they had to fail at least 3 times)
+  * Add patch to reinstate test-libglnx-shutil.c, which was missed out
+    of the upstream tarball
 
  -- Simon McVittie <smcv@debian.org>  Tue, 03 Oct 2017 19:14:14 +0100
 
diff --git a/debian/patches/dist/Add-missing-test-libglnx-shutil.patch b/debian/patches/dist/Add-missing-test-libglnx-shutil.patch
new file mode 100644 (file)
index 0000000..9b07e3d
--- /dev/null
@@ -0,0 +1,108 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Tue, 3 Oct 2017 21:30:36 +0100
+Subject: Add missing test-libglnx-shutil
+
+Because we re-run autogen.sh, we'll regenerate Makefile-libglnx.am.inc
+(which results in the version after this patch, including
+test-libglnx-shutil, being present) and then try to build
+test-libglnx-shutil; but its source code wasn't included in the upstream
+tarball, because Makefile-libglnx.am.inc wasn't up to date at
+"make dist" time.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ libglnx/Makefile-libglnx.am.inc     |  6 +++-
+ libglnx/tests/test-libglnx-shutil.c | 63 +++++++++++++++++++++++++++++++++++++
+ 2 files changed, 68 insertions(+), 1 deletion(-)
+ create mode 100644 libglnx/tests/test-libglnx-shutil.c
+
+diff --git a/libglnx/Makefile-libglnx.am.inc b/libglnx/Makefile-libglnx.am.inc
+index 8766e63..ff2700c 100644
+--- a/libglnx/Makefile-libglnx.am.inc
++++ b/libglnx/Makefile-libglnx.am.inc
+@@ -53,7 +53,7 @@ libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
+ libglnx_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex "^glnx_" -no-undefined -export-dynamic 
+ libglnx_la_LIBADD = $(libglnx_libs)
+-libglnx_tests = test-libglnx-xattrs test-libglnx-fdio test-libglnx-errors test-libglnx-macros
++libglnx_tests = test-libglnx-xattrs test-libglnx-fdio test-libglnx-errors test-libglnx-macros test-libglnx-shutil
+ TESTS += $(libglnx_tests)
+ check_PROGRAMS += $(libglnx_tests)
+@@ -72,3 +72,7 @@ test_libglnx_errors_LDADD = $(libglnx_libs) libglnx.la
+ test_libglnx_macros_SOURCES = libglnx/tests/test-libglnx-macros.c
+ test_libglnx_macros_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
+ test_libglnx_macros_LDADD = $(libglnx_libs) libglnx.la
++
++test_libglnx_shutil_SOURCES = libglnx/tests/test-libglnx-shutil.c
++test_libglnx_shutil_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
++test_libglnx_shutil_LDADD = $(libglnx_libs) libglnx.la
+diff --git a/libglnx/tests/test-libglnx-shutil.c b/libglnx/tests/test-libglnx-shutil.c
+new file mode 100644
+index 0000000..39f261b
+--- /dev/null
++++ b/libglnx/tests/test-libglnx-shutil.c
+@@ -0,0 +1,63 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
++ *
++ * Copyright © 2017 Endless Mobile, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include "config.h"
++#include "libglnx.h"
++#include <glib.h>
++#include <stdlib.h>
++#include <gio/gio.h>
++#include <err.h>
++#include <string.h>
++
++#include "libglnx-testlib.h"
++
++static void
++test_mkdir_p_enoent (void)
++{
++  _GLNX_TEST_DECLARE_ERROR(local_error, error);
++  glnx_fd_close int dfd = -1;
++
++  if (!glnx_ensure_dir (AT_FDCWD, "test", 0755, error))
++    return;
++  if (!glnx_opendirat (AT_FDCWD, "test", FALSE, &dfd, error))
++    return;
++  if (rmdir ("test") < 0)
++    return (void) glnx_throw_errno_prefix (error, "rmdir(%s)", "test");
++
++  /* This should fail with ENOENT. */
++  glnx_shutil_mkdir_p_at (dfd, "blah/baz", 0755, NULL, error);
++  g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND);
++  g_clear_error (&local_error);
++}
++
++int
++main (int    argc,
++      char **argv)
++{
++  int ret;
++
++  g_test_init (&argc, &argv, NULL);
++
++  g_test_add_func ("/mkdir-p/enoent", test_mkdir_p_enoent);
++
++  ret = g_test_run();
++
++  return ret;
++}
index 67272a0868404b900e6c357374586c36d5e6c908..91a74fde869dd2ba8730e09dd39938835e70fa74 100644 (file)
@@ -1,2 +1,3 @@
 2017.13/lib-pull-Fix-regression-with-pull-local-for-nonexistent-r.patch
 2017.13/lib-repo-commit-Import-detached-metadata-even-if-hardlink.patch
+dist/Add-missing-test-libglnx-shutil.patch